package com.elroy_zhongxing.spirit_elroy;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.ScaleAnimation;
import android.widget.ImageView;

/**
 * Created by Elroy on 2017/7/1.
 */
public class ShopView extends BaseView{
    private ImageView iv_chongzhi;
    private ImageView iv_fugure;

    public ShopView(Context context){
        super(context);
        setContentView(R.layout.view_shop);

        initUI();
        fugureScaleAnimation();
    }

    private void fugureScaleAnimation(){
        ScaleAnimation scaleAnimation = new ScaleAnimation(1f, 1f, 0.9f, 0.8f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 1f);
        scaleAnimation.setDuration(800);
        scaleAnimation.setRepeatCount(Animation.INFINITE);//无限重复
        scaleAnimation.setRepeatMode(Animation.REVERSE);
        iv_fugure.startAnimation(scaleAnimation);
    }

    @Override
    protected void initUI(){
        iv_chongzhi = (ImageView) findViewById(R.id.iv_chongzhi);
        AnimUtil.addOnTouchListener(iv_chongzhi, 0.5f, 0.5f, null);
        iv_fugure = (ImageView) findViewById(R.id.iv_fugure);
    }

}

